#include "Cheeky-Cheeky.h"
#include <iostream>

int main()
{
	int count_of_sequences;
	std::cin >> count_of_sequences;
	std::list<std::string> sequences(count_of_sequences);

	for (std::list<std::string>::iterator it = sequences.begin(); it != sequences.end(); ++it)
	{
		std::string s;
		std::cin >> s;
		*it = s;
	}

	Cheeky_Cheeky my_Cheeky_Cheeky(sequences);

	std::list<std::string> solution = my_Cheeky_Cheeky.continuation();

	for (std::list<std::string>::const_iterator it = solution.begin(); it != solution.end(); ++it)
	{
		std::cout << *it << "..." << std::endl;
	}
	return 0;
}
